<div class="row-content am-cf">
	<div class="row">
		<div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
			<div class="widget am-cf">
				<div class="widget-head am-cf">
					<div class="widget-title am-fl">编辑角色</div>
					<div class="widget-function am-fr">
						<a href="javascript:;" class="am-icon-cog"></a>
					</div>
				</div>
				<div class="widget-body am-fr">
					<form class="am-form tpl-form-line-form" id="roleForm" method="post">
					
						<input type="hidden"  name="id" th:value="${role.id}" /> 
						
						<div class="am-form-group">
							<label for="name" class="am-u-sm-2 am-form-label"><span class="text-red"> *</span>角色名称：</label>
							<div class="am-u-sm-10">
								<input type="text" id="name" class="tpl-form-input" placeholder="请输入角色名称" name="name" th:value="${role.name}" /> 
							</div>
						</div>
						
						<!-- <div class="am-form-group">
							<label for="key" class="am-u-sm-2 am-form-label">角色标识<span class="text-red"> *</span></label>
							<div class="am-u-sm-10">
								<input type="text" id="key" class="tpl-form-input" placeholder="请输入角色标识" name="key" th:value="${role.key}"/> 
							</div>
						</div> -->
						
						<input type="hidden"  name="companyId" th:value="${role.companyId}" /> 
						
						<div class="am-form-group">
							<label for="description" class="am-u-sm-2 am-form-label">说明：</label>
							<div class="am-u-sm-10">
								<input type="text" id="description" class="tpl-form-input" placeholder="请输入说明" name="description" th:value="${role.description}"/> 
							</div>
						</div>
						

						<div class="am-form-group">
							<div class="am-u-sm-10 am-u-sm-push-2">
								
								<button type="button" onclick="javascript:$('#roleForm').submit();"
									class="am-btn am-btn-primary tpl-btn-bg-color-success ">提交</button>
										<button type="button" onclick="loadPage('role/listUI')"
									class="am-btn am-btn-success tpl-btn-bg-color-success ">返回</button>
							</div>
						</div>
					</form>
				</div>
			</div>
		</div>
	</div>

	</div>
	<script th:inline="javascript">
	<![CDATA[
	//$('select').selected();
	validateUserForm();
	function validateUserForm(){    
	    $('#roleForm').validate({
	        errorElement : 'span',
	        errorClass : 'am-icon-times',
	        focusInvalid : true,
	        onkeyup:false,
	        ignore : "",
	        rules : {
	            name : {
	                required : true,
	                maxlength : 50
	            },
	            description : {
	            	maxlength : 50
	            }
	        },
	        messages : {
	        	name : {
	                required : "请填写角色名称"
	            }
	        },
	        submitHandler : function(form) {
	        	commit('roleForm', 'role/save', 'role/listUI');
	        }
	    });
	}
		]]>
	</script>